<template>
  <div class="page">
    <el-form ref="form" :model="form" label-width="90px">
      <el-row>
        <el-col :span="9">
          <el-form-item label="申请时间段">
            <el-date-picker v-model="form.starttime" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" style="width: 135px;"></el-date-picker>~
            <el-date-picker v-model="form.endtime" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" style="width: 135px;"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="公司名称" prop="companyname">
            <el-input v-model="form.companyname" placeholder="请输入公司名称" style="width: 160px;" clearable></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="5">
          <el-form-item label="开票状态" prop="status">
            <el-select v-model="form.result" placeholder="请选择">
              <el-option v-for="item in statusOptions" :key="item.status" :label="item.label" :value="item.status" clearable></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="4" style="text-align: right;">
          <el-button type="primary" style="width: 100px;" @click="query">查询</el-button>
        </el-col>
      </el-row>
      <el-row>
			<el-form-item label="地区查询" >
          <cityCascader
            :citys="region"
            level="0"
            @handleChange="handleCityChange"
          ></cityCascader>
        </el-form-item>
      </el-row>
    </el-form>
    <div class="page-content" v-loading="loading">
      <el-table stripe :data="tableData" style="width: 100%" size="small" border>
        <el-table-column prop="invoicetype" label="发票类型" align="center"></el-table-column>
        <el-table-column prop="companyname" label="企业名称" align="center"></el-table-column>
        <!-- <el-table-column prop="companyname" label="发票抬头" align="center">
        </el-table-column>-->
        <el-table-column prop="identifynum" label="纳税人识别号" align="center" width="210px"></el-table-column>
        <el-table-column prop="invoicenum" label="开票金额" align="center"></el-table-column>

        <el-table-column prop="applydate" label="申请时间" align="center"></el-table-column>
        <el-table-column prop="result" label="开票结果" align="center"></el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <el-button type="text" class="operate" @click="download(scope.row.pdfpath)">下载</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div style="margin-top: 22px;">
        <el-pagination background :current-page="form.pagenum" :page-size="form.pagesize" layout="total, sizes, prev, pager, next, jumper" :total="total" :page-sizes="[10, 20, 30, 50, 100]" @current-change="handleCurrentChange" @size-change="handleSizeChange"></el-pagination>
      </div>
    </div>
  </div>
</template>

<script src="./index.js"></script>

<style src="./index.css" scoped>
</style>

